<?php 

//echo "<a href='secure.php?logout'><b>Logout<b></a>";
//echo "<div align='center'>You Are inside secured Page</a>"; 
include("files/php/global.php"); 
printHeader();

?>

<head>

<!-- Javascript -->
<script language=JavaScript src="./files/js/alarm_ajax.js"></script>

<script type="text/javascript" src="./files/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="./files/js/jquery-1.3.min.js"></script>

<!-- STYLE -->
<!--<link rel="stylesheet" href="./styles/home.css" type="text/css" />-->
<!-- ADD TAB -->
<link rel="stylesheet" href="./style/vtabs.css" type="text/css" />
<style>

select {
    width: 250px;
    color: #555;
/*    padding: 4px 4px 3px;*/
    border: 2px solid #B5B8C8;
    font-size: 14px;
/*    margin-top: 4px;
    margin-bottom: 4px;*/
    background: #FFFFFF;
}
        </style>
<script type="text/javascript"> // Pop-UP
    var sec = "";
    var giorni="";
    function pop(sec)
    {
        
              NewWindow=window.open('./files/php/show-pop.php?id='+sec+'&giorni='+giorni,'newWin','width=940,height=425,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=No');
              NewWindow.focus();
    }
    
    function save_section(osec)
    {	
            sec = osec;	
    }
    
    function menuTime(links,sezione) 
    {
        if(links)
            giorni=links[links.selectedIndex].value;
        sec=sezione;
        
        getData('./files/php/alarm_ajax_exec.php?id='+sec+'&giorni='+giorni,'showDiv1','');
        
    }
   
    $(document).ready(function() {
        
        save_section('1');
        giorni=2;
        getData('./files/php/alarm_ajax_exec.php?id=1&giorni=2','showDiv1','');
        
        $("#vtab-column ul li").click(function() {
            $("#vtab-column ul li").removeClass("selected"); //Remove any "active" class
            $(this).addClass("selected"); //Add "active" class to selected tab
            return true;
        });	
    });
</script>

</head>

	<div id="vtab-column">
			<ul class="tabs"> <!-- class=\"selected\" -->
                                <?php
                                        
                                        for($i=1;$i<=NUM_SEZIONI;$i++)
                                        {
                                            
                                            if($i==1)
                                                echo "<li onclick=\"save_section($i');\" class=\"selected\" >";
                                            else
                                                echo "<li onclick=\"save_section('$i');\">";
                                             
                                             echo "<a href=\"javascript:menuTime(0,$i);\" >Sezione $i</a>
                                             </li>";    

                                        }
                                        echo "<li onclick=\"save_section('$i');\">
                                                <a href=\"javascript:menuTime(0,$i);\">Rasponi</a>
                                              </li>";
                                ?>
				</ul>
	</div>
	<div id="showDiv1">  </div>
	<div id="vtab-footer">
                        <select onChange="javascript:menuTime(this,sec);" name="begindate">
                                <option value="2">2 giorni</option>
                                <option value="7">1 settimana</option>
                                <option value="30">1 mese</option>
                                <option value="60">2 mesi</option>
                                <option value="90">3 mesi</option>
                                <option value="180">6 mesi</option>
                                <option value="240">8 mesi</option>
                                <option value="365">1 anno</option>
                        </select>
            		
			<a href="javascript:pop(sec);" class="button pngfix">Pop Up</a> 
	</div>
</body>
	
</html>